#include "ray.h"

Ray::Ray()
    : origin(), direction()
{

}
Ray::~Ray()
{

}

Ray::Ray(const Ray &ray)
    : origin(ray.origin), direction(ray.direction)
{

}

Ray& Ray::operator=(const Ray &ray)
{
    origin    = ray.origin;
    direction = ray.direction;
    return (*this);
}

Ray::Ray(const Point3D &_origin, const Vector3D &_direction)
    : origin(_origin), direction(_direction)
{

}

Ray::Ray(const double &x, const double &y, const double &z, const double &dx, const double &dy, const double &dz)
    : origin(x,y,z), direction(dx,dy,dz)
{

}

inline void Ray::setOrigin(const Point3D &_origin)
{
    origin = _origin;
}

inline void Ray::setOrigin(const double &x, const double &y, const double &z)
{
    origin = Point3D(x,y,z);
}

inline Point3D Ray::getOrigin() const
{
    return origin;
}

inline void Ray::setDirection(const Vector3D &_direction)
{
    direction = _direction;
}

inline void Ray::setDirection(const double &dx, const double &dy, const double &dz)
{
    direction = Vector3D(dx,dy,dz);
}

inline Vector3D Ray::getDirection() const
{
    return direction;
}

inline void Ray::setXDir(const double &dx)
{
    direction.setX(dx);
}

inline void Ray::setYDir(const double &dy)
{
    direction.setY(dy);
}

inline void Ray::setZDir(const double &dz)
{
    direction.setZ(dz);
}

inline void Ray::incXDir()
{
    direction.incX();
}

inline void Ray::incYDir()
{
    direction.incY();
}

inline void Ray::incZDir()
{
    direction.incZ();
}

inline void Ray::normalize()
{
    direction.normalize();
}


